import { defineStore } from 'pinia'
import { userKey, productsKey } from "@/store/keys";
import { Obj } from '@popperjs/core';

interface IUserStore {
  username: String;
}

interface IProductsStore {
  products: ProductsParmas | {};
}


// 状态管理库
export const useStore = defineStore(userKey, {
  state(): IUserStore {
    return {
      username: "",
    }
  }
})

export const productsStore = defineStore(productsKey, {
  state(): IProductsStore {
    return {
      products: {},
    }
  },
  actions: {
    reset() {
      this.products = {};
    }
  }
})